package model.market;

//AMLOW: this sucker going to work in initial periods?
public class MarketFinanceCharge implements FinanceCharge {

	@Override
	public double getPeriodFinanceCharge(Position pos,
			MarketInformation marketInfo, MarketManager manager,
			double currentRiskFree, double indexDivYield,
			double indexCapitalReturn) {
		double requiredReturn = currentRiskFree/manager.getConfig().getPeriodsInYear()+
			(indexCapitalReturn+(indexDivYield-currentRiskFree)/manager.getConfig().getPeriodsInYear());
		
		return -pos.getWorth(marketInfo.getMarketPrices())*requiredReturn;
	}

}
